﻿using Core;
using Core.Base;
using Core.Base.Module;
using Core.Mgrs;
using Global.Mgr;
using UnityEngine;

namespace Global.Module
{
    /// <summary>
    /// 全局，永不被卸载
    /// </summary>
    [Module(true)]
    public class GlobalModule : BaseModule
    {
        protected override void InitMgr()
        {
            KKGL.AudioMgr = RegMgr<AudioMgr>();
            KKGL.ConfigMgr = RegMgr<ConfigMgr>();
            KKGL.GameSettingMgr = RegMgr<GameSettingMgr>();
            KKGL.ModelMgr = RegMgr<ModelMgr>();
            KKGL.ResMgr = RegMgr<ResMgr>();
            KKGL.SceneMgr = RegMgr<SceneMgr>();
            KKGL.TimerMgr = RegMgr<TimerMgr>();
            KKGL.WebMgr = RegMgr<WebMgr>();
            KKGL.CancelTokenMgr = RegMgr<CancelTokenMgr>();

            KKGL.CancelTokenMgr.AttachCancelToken(KKGL.SysEvent);
            KKGL.CancelTokenMgr.AttachCancelToken(KKGL.UIEvent);
        }
    }
}